//
//  MineStyle.h
//  Mine
//
//  Created by ling on 12-11-8.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "Sstyle.h"

@implementation Sstyle


+(UIFont*)boldItalicSystemFontOfSize:(CGFloat)fontSize
{
    return [UIFont fontWithName:@"Helvetica-BoldOblique" size:fontSize] ? : [UIFont italicSystemFontOfSize:fontSize];
}

+(UIFont*)klavikaOfSize:(CGFloat)size bold:(bool)aBold
{
    NSString * fontName = aBold ? @"KlavikaBasic-Bold" : @"KlavikaBasic-Regular";
    NSString * fallbackName = aBold ? @"HelveticaNeue-Bold" : @"HelveticaNeue-Regular";
    // Bold map:
    //   13 -> 12
    //   14 -> 12
    //   15 -> 14
    //   17 -> 15
    // Normal map:
    //   15 -> 15. Hm.
    CGFloat fallbackSize = size - (size/12);
    return [UIFont fontWithName:fontName size:size] ? : [UIFont fontWithName:fallbackName size:fallbackSize] ? : [UIFont boldSystemFontOfSize:fallbackSize];
}

+(UIFont*)klavikaBold:(CGFloat)size
{
    return [self klavikaOfSize:size bold:true];
}

+(UIFont*)klavikaRegular:(CGFloat)size
{
    return [self klavikaOfSize:size bold:false];
}

+(UIFont*)HelveticaBold:(CGFloat)size
{
    return [UIFont fontWithName:@"Helvetica-Bold" size:size] ? : [UIFont boldSystemFontOfSize:size];
}
@end
